package com.nuoniu.sibanyun.controller.finance;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nuoniu.sibanyun.common.BaseController;
import com.nuoniu.sibanyun.common.result.HttpResult;
import com.nuoniu.sibanyun.service.finance.IInSubsidiaryService;
import com.nuoniu.sibanyun.service.finance.IInSummaryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 存货总账表 前端控制器
 * </p>
 *
 * @author 小啊刚
 * @since 2021-05-26
 */
@RestController
@RequestMapping("/inSummary")
@Api(tags = "存货总账管理")
public class InSummaryController extends BaseController {

    @Autowired
    private IInSubsidiaryService subsidiaryService;
    @Autowired
    private IInSummaryService summaryService;

    @ApiOperation("获取存货明细账列表")
    @GetMapping("pageSubsidiaryList")
    public HttpResult pageSubsidiaryList(Page page, Integer inventoryId, Integer accountYear, Integer accountPeriod) {
        return HttpResult.ok(subsidiaryService.pageSubsidiaryList(page, inventoryId, accountYear, accountPeriod));
    }

    @ApiOperation("获取存货总账列表")
    @GetMapping("pageSummaryList")
    public HttpResult pageSummaryList(Page page, Integer inventoryId, Integer accountYear, Integer accountPeriod) {
        return HttpResult.ok(summaryService.pageSummaryList(page, inventoryId, accountYear, accountPeriod));
    }
}
